var config = require('../../../config/app.config')

export function getAuthInfo (redirectUri) {
  console.log('调用了微信授权')
  let customerId = window.localStorage.getItem('customerId')
  console.log(customerId)
  if (customerId !== null) {
    console.log('customerId存在')
    return
  }
  console.log('customerId不存在')
  let appId = config.appid
  let domain = config.domain + redirectUri
  console.log(appId)
  console.log(domain)
  let wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appId + '&redirect_uri=' + domain + '&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'
  window.location.href = wxUrl
}
